#include "stm32f10x.h"                  // Device header
#include "oled.h"
#include "PWM.h"
#include "Delay.h"

uint8_t KeyNum = 0;

int main(int argc, char *argv[])
{	
	int i = 0;
	OLED_Init();
	OLED_ShowString(1, 1, "PWM Timer OC");
	
	PWM_Init(TIM2);
	PWM_Init(TIM3);
	TIM_Cmd(TIM2, ENABLE);
	TIM_Cmd(TIM3, ENABLE);
	
	while(1)
	{
		for(i=0; i<=100; i++)
		{
			PWM_SetCompare1(TIM2, i);
			PWM_SetCompare1(TIM3, i);
			Delay_ms(12);
		}
		
		for(i=0; i<=100; i++)
		{
			PWM_SetCompare1(TIM2, 100-i);
			PWM_SetCompare1(TIM3, 100-i);
			Delay_ms(12);
		}
	}
	
	return 1;
}

